<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>发起仲裁</title>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="<%=path %>/resource/lib/layui/layui/css/layui.css"  media="all">
<style>
    .layui-main2 {
        margin: 15px;
        line-height: 22px;
    }
</style>
</head>
<body>
<div class="layui-main2">
<blockquote class="layui-elem-quote layui-text">
    仲裁申请
</blockquote>

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>申请信息</legend>
</fieldset>
<form class="layui-form" action="" lay-filter="applyForm">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">机构编号</label>
            <div class="layui-input-inline">
                <input type="text" name="clientId" readonly lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">产品编号</label>
            <div class="layui-input-inline">
                <input type="text" name="productId" readonly lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">产品名称</label>
            <div class="layui-input-inline">
                <input type="text" name="productName" readonly value="信托贷款"   lay-verify="required" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">当事人名称</label>
            <div class="layui-input-inline">
                <input type="text" name="name" readonly lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">当事人类型</label>
            <div class="layui-input-inline">

                <input type="radio" readonly name="litigantType" value="1" title="被申请人" checked="">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">当事人性质</label>
            <div class="layui-input-inline">
                <select readonly name="nature" lay-filter="aihao">
                    <option value=""></option>
                    <option value="0"  selected>自然人</option>
               <%--     <option value="1"  >企业</option>
                    <option value="2" selected="">个体户</option>
                    <option value="3">其他组织</option>--%>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">当事人电话</label>
            <div class="layui-input-inline">
                <input readonly type="text" name="phoneNumber" lay-verify="required" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">证件类型</label>

            <div  class="layui-input-block">
                <input readonly type="radio" name="identityType" value="2" title="身份证" checked="">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">证件号码</label>
            <div class="layui-input-inline">
                <input readonly type="text" name="identityNumber" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-block">
                <input type="radio" name="gender" value="0" title="男">
                <input type="radio" name="gender" value="1" title="女">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">生日</label>
            <div class="layui-input-inline">
                <input readonly type="text" name="birthday" id="d1" lay-verify="date|required" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">民族</label>
            <div class="layui-input-inline">
                <input readonly type="text" name="nation" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">地址</label>
            <div class="layui-input-inline">
                <input readonly type="text" name="address" lay-verify="required" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">借款金额</label>
            <div class="layui-input-inline">
                <input readonly type="text" name="loanAmount" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">标的金额</label>
            <div class="layui-input-inline">
                <input readonly type="text" name="disputeFee" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">利率类型</label>
            <div class="layui-input-block">
                <select readonly name="interestType" lay-filter="aihao">
                    <option value=""></option>
                    <option value="1" selected="">年利率</option>
                    <option value="2" >月利率</option>
                    <option value="3">日利率</option>
                </select>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">利率</label>
            <div class="layui-input-inline">
                <input readonly type="text" name="interestRate" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">借款开始日期</label>
            <div class="layui-input-inline">
                <input readonly type="text" name="borrowingStartDate" id="d2"  lay-verify="date|required" placeholder="yyyy-MM-dd" autocomplete="off"  class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">借款结束日期</label>
            <div class="layui-input-inline">
                <input readonly type="text" name="borrowingEndDate" id="d3"   lay-verify="date|required" placeholder="yyyy-MM-dd" autocomplete="off"  class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">借款期数</label>
            <div class="layui-input-inline">
                <input readonly type="text" name="borrowingNum" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">还款方式</label>
            <div class="layui-input-block">
                <select readonly name="returnType" lay-filter="aihao">
                    <option value=""></option>
                    <option value="1" selected="">等额本息</option>
                    <option value="2" >等额本金</option>
                    <option value="3">先息后本</option>
                    <option value="4">先本后息</option>
                    <option value="5">一次性还本付息</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label"></label>
            <div class="layui-input-inline">

            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">放款账号</label>
            <div class="layui-input-inline">
                <input type="text" name="paymentAccount" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">放款账号银行</label>
            <div class="layui-input-inline">
                <input type="text" name="paymentBank" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">放款日期</label>
            <div class="layui-input-inline">
                <input type="text" name="paymentDate" id="d6"   lay-verify="date|required" placeholder="yyyy-MM-dd" autocomplete="off"  class="layui-input">

          
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">逾期日期</label>
            <div class="layui-input-inline">
                <input type="text" name="overdueDate" id="d4"   lay-verify="date|required" placeholder="yyyy-MM-dd" autocomplete="off"  class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">逾期期数</label>
            <div class="layui-input-inline">
                <input type="text" name="overdueNum" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label"></label>
            <div class="layui-input-inline">

            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">小贷合同号</label>
            <div class="layui-input-inline">
                <input type="text" name="xdContractCode"   readonly class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">仲裁合同号</label>
            <div class="layui-input-inline">
                <input type="text" name="contractCode" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">合同签订日期</label>
            <div class="layui-input-inline">
                <input type="text" name="conclusionData" id="d5"   lay-verify="date|required" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">纠纷类型</label>
            <div class="layui-input-inline">
                <input type="text" name="mediationType"  value="追偿权纠纷"  lay-verify="required" class="layui-input">
            </div>
        </div>

    </div>
   <%-- name String 必选 代理人姓名
    agentType Int 必选 代理类型 一般代理：1
    特殊代理：2
    identityType Int 必选 证照类型 身份证：1
    identityNumber String 必选 证照号码--%>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">代理人姓名</label>
            <div class="layui-input-inline">
                <input type="text" name="agentName" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">代理类型</label>
            <div class="layui-input-inline">
                <select name="agentType"  >
                    <option value=""  checked=""></option>
                    <option value="1" >一般代理</option>
                    <option value="2">特殊代理</option>
                </select>
            </div>
        </div>R
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">代理人身份证</label>
            <div class="layui-input-inline">
                <input type="radio" name="agentIdentityType" value="1" title="身份证" checked="">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">代理证照号码</label>
            <div class="layui-input-inline">
                <input type="text" name="agentIdentityNumber"   class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">事实与理由</label>
            <div class="layui-input-block">
                <textarea name="reason" lay-verify="required" placeholder="事实与理由" class="layui-textarea"></textarea>
            </div>
        </div>

    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">仲裁请求内容</label>
            <div class="layui-input-block">
                <textarea name="claimContent" lay-verify="required" placeholder="仲裁请求内容" class="layui-textarea"></textarea>
            </div>
        </div>

    </div>


</form>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
    <legend>保全文件</legend>
</fieldset>
    <div id ="bqwj"></div>

</div>
<script src="<%=path %>/resource/lib/layui/layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layui.use(['form', 'jquery','layedit', 'laydate', 'upload', 'layer'], function(){
        var $ = layui.$ ;//重点处
        var form = layui.form
            ,layer = layui.layer
            ,upload=layui.upload
            ,layedit = layui.layedit
            ,laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#d1'
        });
        laydate.render({
            elem: '#d2'
        });
        laydate.render({
            elem: '#d3'
        });
        laydate.render({
            elem: '#d4'
        });
        laydate.render({
            elem: '#d5'
        });
        laydate.render({
            elem: '#d6'
        });
        $.get('<%=path%>/arbitration/tcarbapply/fileList.do?applyId='+getQueryVariable("id"),function (data) {
                    var html = "";
                    let data1 = data.data;
            $.each(data1,function(key,value){
                html+=" <div class=\"layui-upload\">\n" +
                    "        <button type=\"button\" class=\"layui-btn\" id=\""+key+"\" BQZL=\"BQZL\" upType=\""+key+"\">"+value+"</button>\n" +
                    "        <div class=\"layui-upload-list\">\n" +
                    "            <p id=\""+key+"-a\"></p>\n" +
                    "        </div>\n" +
                    "    </div>";
            });
            $("#bqwj").html(html);
            $("[BQZL='BQZL']").each(function (i,o) {
                let id = $(o).attr("id");
                uploadFile(id,getQueryVariable("id"),id);
            });
        },"json");

        function uploadFile(did,alllyId,templateCode){
            $.get('<%=path%>/arbitration/tcarbapply/getFile.do?applyId='+alllyId+'&templateCode='+templateCode,function (data) {
                    if(data.success==1){
                        if(data.data==undefined||data.data==null){

                        }else{
                            var html = "";
                            $(data.data).each(function (i,o) {
                                html+="<p>"+o.fileAbsPath+"</p>";
                            });
                            $("#"+did+"-a").html(html);

                        }

                    }else{

                    }
            },"json")


        }




        $.post('<%=path%>/arbitration/tcarbapply/applyInfo.do?id='+getQueryVariable("id"),function (data) {
            if(data.success==1){
                form.val('applyForm', data.data);
            }

        },"json");



    });


    function getQueryVariable(variable)
    {
        var query = window.location.search.substring(1);
        var vars = query.split("&");
        for (var i=0;i<vars.length;i++) {
            var pair = vars[i].split("=");
            if(pair[0] == variable){return pair[1];}
        }
        return(false);
    }



</script>

</body>
</html>